#pragma once

#ifndef _FILE_MGR_HPP_
#define _FILE_MGR_HPP_

#include "binary.hpp"
#include "utils/pointer.hpp"

#include <string>

class File : public Counter
{
public:
	~File() { close(); }
	virtual int size() = 0;
	virtual int read( char * buffer, int size ) = 0;
	virtual void close() = 0;
	virtual void seek( int pos ) = 0;
};

typedef Pointer< File > FilePtr;

class FileMgr
{
public:
	FileMgr() {}
	virtual ~FileMgr() {}

	virtual FilePtr open( const std::string & name ) = 0;
	virtual BinaryPtr read( const std::string & name ) = 0;


	// helper function
	static std::string formatPath( const std::string & p );

private:
};

#endif
